package ch03_程序流程控制;

import java.util.Scanner;

public class Ch3_10 {
	public static void main(String[] args) {
		int n,i;
		Scanner s=new Scanner(System.in);
		System.out.println("请输入整数：");
		n=s.nextInt(); 
		for(i=2;i<=n-1;i++) {
			if(n%i==0) {
				break;
			}
		}
		if(i==n) {
			System.out.println(n+"是素数");
		}
		else {
			System.out.println(n+"不是素数");
		}
	}
}
